package com.eight.feign;

import com.eight.vo.ComResult;
import com.eight.vo.OrderPayVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;

@FeignClient("rentcar-system")
public interface AliPayFeign {

    /**
     * 生产一个支付宝订单信息
     * @param tbOrder 支付宝订单信息
     * @return 生产的结果
     */
    @RequestMapping(value = "/system/payment/pay")
    @ResponseBody
    ComResult aliPay(@RequestBody OrderPayVo tbOrder);

    /**
     * 校验支付宝是否已经支付
     * @param order 订单信息
     * @return 校验结果
     */
    @PostMapping("/system/payment/isPay")
    boolean isPay(@RequestBody OrderPayVo order);


}

